.class public Lcom/wmr/Lstview/XListView;
.super Landroid/widget/ListView;
.source "XListView.java"

# interfaces
.implements Landroid/widget/AbsListView$OnScrollListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/wmr/Lstview/XListView$IXListViewListener;,
        Lcom/wmr/Lstview/XListView$OnXScrollListener;
    }
.end annotation


# static fields
.field private static final OFFSET_RADIO:F = 1.8f

.field private static final PULL_LOAD_MORE_DELTA:I = 0x32

.field private static final SCROLLBACK_FOOTER:I = 0x1

.field private static final SCROLLBACK_HEADER:I = 0x0

.field private static final SCROLL_DURATION:I = 0x190


# instance fields
.field private mEnablePullLoad:Z

.field private mEnablePullRefresh:Z

.field private mFooterView:Lcom/wmr/Lstview/XListViewFooter;

.field private mHeaderTimeView:Landroid/widget/TextView;

.field private mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

.field private mHeaderViewContent:Landroid/widget/RelativeLayout;

.field private mHeaderViewHeight:I

.field private mIsFooterReady:Z

.field private mLastY:F

.field private mListViewListener:Lcom/wmr/Lstview/XListView$IXListViewListener;

.field private mPullLoading:Z

.field private mPullRefreshing:Z

.field private mScrollBack:I

.field private mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

.field private mScroller:Landroid/widget/Scroller;

.field private mTotalItemCount:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    const/4 v1, 0x0

    .line 76
    invoke-direct {p0, p1}, Landroid/widget/ListView;-><init>(Landroid/content/Context;)V

    .line 34
    const/high16 v0, -0x40800000    # -1.0f

    iput v0, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    .line 48
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    .line 49
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    .line 55
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mIsFooterReady:Z

    .line 77
    invoke-direct {p0, p1}, Lcom/wmr/Lstview/XListView;->initWithContext(Landroid/content/Context;)V

    .line 78
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    const/4 v1, 0x0

    .line 81
    invoke-direct {p0, p1, p2}, Landroid/widget/ListView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 34
    const/high16 v0, -0x40800000    # -1.0f

    iput v0, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    .line 48
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    .line 49
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    .line 55
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mIsFooterReady:Z

    .line 82
    invoke-direct {p0, p1}, Lcom/wmr/Lstview/XListView;->initWithContext(Landroid/content/Context;)V

    .line 83
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyle"    # I

    .prologue
    const/4 v1, 0x0

    .line 86
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ListView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 34
    const/high16 v0, -0x40800000    # -1.0f

    iput v0, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    .line 48
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    .line 49
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    .line 55
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mIsFooterReady:Z

    .line 87
    invoke-direct {p0, p1}, Lcom/wmr/Lstview/XListView;->initWithContext(Landroid/content/Context;)V

    .line 88
    return-void
.end method

.method static synthetic access$0(Lcom/wmr/Lstview/XListView;)Landroid/widget/RelativeLayout;
    .locals 1

    .prologue
    .line 45
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewContent:Landroid/widget/RelativeLayout;

    return-object v0
.end method

.method static synthetic access$1(Lcom/wmr/Lstview/XListView;I)V
    .locals 0

    .prologue
    .line 47
    iput p1, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewHeight:I

    return-void
.end method

.method static synthetic access$2(Lcom/wmr/Lstview/XListView;)V
    .locals 0

    .prologue
    .line 264
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->startLoadMore()V

    return-void
.end method

.method private initWithContext(Landroid/content/Context;)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 91
    new-instance v0, Landroid/widget/Scroller;

    new-instance v1, Landroid/view/animation/DecelerateInterpolator;

    invoke-direct {v1}, Landroid/view/animation/DecelerateInterpolator;-><init>()V

    invoke-direct {v0, p1, v1}, Landroid/widget/Scroller;-><init>(Landroid/content/Context;Landroid/view/animation/Interpolator;)V

    iput-object v0, p0, Lcom/wmr/Lstview/XListView;->mScroller:Landroid/widget/Scroller;

    .line 94
    invoke-super {p0, p0}, Landroid/widget/ListView;->setOnScrollListener(Landroid/widget/AbsListView$OnScrollListener;)V

    .line 97
    new-instance v0, Lcom/wmr/Lstview/XListViewHeader;

    invoke-direct {v0, p1}, Lcom/wmr/Lstview/XListViewHeader;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    .line 98
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    .line 99
    const v1, 0x7f0c0388

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewHeader;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/RelativeLayout;

    .line 98
    iput-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewContent:Landroid/widget/RelativeLayout;

    .line 100
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    .line 101
    const v1, 0x7f0c038b

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewHeader;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 100
    iput-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderTimeView:Landroid/widget/TextView;

    .line 102
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {p0, v0}, Lcom/wmr/Lstview/XListView;->addHeaderView(Landroid/view/View;)V

    .line 105
    new-instance v0, Lcom/wmr/Lstview/XListViewFooter;

    invoke-direct {v0, p1}, Lcom/wmr/Lstview/XListViewFooter;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    .line 108
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v0}, Lcom/wmr/Lstview/XListViewHeader;->getViewTreeObserver()Landroid/view/ViewTreeObserver;

    move-result-object v0

    .line 109
    new-instance v1, Lcom/wmr/Lstview/XListView$1;

    invoke-direct {v1, p0}, Lcom/wmr/Lstview/XListView$1;-><init>(Lcom/wmr/Lstview/XListView;)V

    .line 108
    invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V

    .line 117
    return-void
.end method

.method private invokeOnScrolling()V
    .locals 2

    .prologue
    .line 197
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    instance-of v1, v1, Lcom/wmr/Lstview/XListView$OnXScrollListener;

    if-eqz v1, :cond_0

    .line 198
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    check-cast v0, Lcom/wmr/Lstview/XListView$OnXScrollListener;

    .line 199
    .local v0, "l":Lcom/wmr/Lstview/XListView$OnXScrollListener;
    invoke-interface {v0, p0}, Lcom/wmr/Lstview/XListView$OnXScrollListener;->onXScrolling(Landroid/view/View;)V

    .line 201
    .end local v0    # "l":Lcom/wmr/Lstview/XListView$OnXScrollListener;
    :cond_0
    return-void
.end method

.method private resetFooterHeight()V
    .locals 6

    .prologue
    const/4 v1, 0x0

    .line 255
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v0}, Lcom/wmr/Lstview/XListViewFooter;->getBottomMargin()I

    move-result v2

    .line 256
    .local v2, "bottomMargin":I
    if-lez v2, :cond_0

    .line 257
    const/4 v0, 0x1

    iput v0, p0, Lcom/wmr/Lstview/XListView;->mScrollBack:I

    .line 258
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScroller:Landroid/widget/Scroller;

    neg-int v4, v2

    .line 259
    const/16 v5, 0x190

    move v3, v1

    .line 258
    invoke-virtual/range {v0 .. v5}, Landroid/widget/Scroller;->startScroll(IIIII)V

    .line 260
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->invalidate()V

    .line 262
    :cond_0
    return-void
.end method

.method private resetHeaderHeight()V
    .locals 7

    .prologue
    const/4 v1, 0x0

    .line 220
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v0}, Lcom/wmr/Lstview/XListViewHeader;->getVisiableHeight()I

    move-result v2

    .line 221
    .local v2, "height":I
    if-nez v2, :cond_1

    .line 237
    :cond_0
    :goto_0
    return-void

    .line 224
    :cond_1
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    if-eqz v0, :cond_2

    iget v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewHeight:I

    if-le v2, v0, :cond_0

    .line 227
    :cond_2
    const/4 v6, 0x0

    .line 229
    .local v6, "finalHeight":I
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    if-eqz v0, :cond_3

    iget v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewHeight:I

    if-le v2, v0, :cond_3

    .line 230
    iget v6, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewHeight:I

    .line 232
    :cond_3
    iput v1, p0, Lcom/wmr/Lstview/XListView;->mScrollBack:I

    .line 233
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScroller:Landroid/widget/Scroller;

    sub-int v4, v6, v2

    .line 234
    const/16 v5, 0x190

    move v3, v1

    .line 233
    invoke-virtual/range {v0 .. v5}, Landroid/widget/Scroller;->startScroll(IIIII)V

    .line 236
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->invalidate()V

    goto :goto_0
.end method

.method private startLoadMore()V
    .locals 2

    .prologue
    .line 265
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullLoading:Z

    .line 266
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    const/4 v1, 0x2

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewFooter;->setState(I)V

    .line 267
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mListViewListener:Lcom/wmr/Lstview/XListView$IXListViewListener;

    if-eqz v0, :cond_0

    .line 268
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mListViewListener:Lcom/wmr/Lstview/XListView$IXListViewListener;

    invoke-interface {v0}, Lcom/wmr/Lstview/XListView$IXListViewListener;->onLoadMore()V

    .line 270
    :cond_0
    return-void
.end method

.method private updateFooterHeight(F)V
    .locals 3
    .param p1, "delta"    # F

    .prologue
    .line 240
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v1}, Lcom/wmr/Lstview/XListViewFooter;->getBottomMargin()I

    move-result v1

    float-to-int v2, p1

    add-int v0, v1, v2

    .line 241
    .local v0, "height":I
    iget-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mEnablePullLoad:Z

    if-eqz v1, :cond_0

    iget-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullLoading:Z

    if-nez v1, :cond_0

    .line 242
    const/16 v1, 0x32

    if-le v0, v1, :cond_1

    .line 244
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Lcom/wmr/Lstview/XListViewFooter;->setState(I)V

    .line 249
    :cond_0
    :goto_0
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v1, v0}, Lcom/wmr/Lstview/XListViewFooter;->setBottomMargin(I)V

    .line 252
    return-void

    .line 246
    :cond_1
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/wmr/Lstview/XListViewFooter;->setState(I)V

    goto :goto_0
.end method

.method private updateHeaderHeight(F)V
    .locals 4
    .param p1, "delta"    # F

    .prologue
    const/4 v3, 0x0

    .line 204
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    float-to-int v1, p1

    .line 205
    iget-object v2, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v2}, Lcom/wmr/Lstview/XListViewHeader;->getVisiableHeight()I

    move-result v2

    add-int/2addr v1, v2

    .line 204
    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewHeader;->setVisiableHeight(I)V

    .line 206
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    if-nez v0, :cond_0

    .line 207
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v0}, Lcom/wmr/Lstview/XListViewHeader;->getVisiableHeight()I

    move-result v0

    iget v1, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewHeight:I

    if-le v0, v1, :cond_1

    .line 208
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewHeader;->setState(I)V

    .line 213
    :cond_0
    :goto_0
    invoke-virtual {p0, v3}, Lcom/wmr/Lstview/XListView;->setSelection(I)V

    .line 214
    return-void

    .line 210
    :cond_1
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v0, v3}, Lcom/wmr/Lstview/XListViewHeader;->setState(I)V

    goto :goto_0
.end method


# virtual methods
.method public computeScroll()V
    .locals 2

    .prologue
    .line 327
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v0}, Landroid/widget/Scroller;->computeScrollOffset()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 328
    iget v0, p0, Lcom/wmr/Lstview/XListView;->mScrollBack:I

    if-nez v0, :cond_1

    .line 329
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v1}, Landroid/widget/Scroller;->getCurrY()I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewHeader;->setVisiableHeight(I)V

    .line 333
    :goto_0
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->postInvalidate()V

    .line 334
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->invokeOnScrolling()V

    .line 336
    :cond_0
    invoke-super {p0}, Landroid/widget/ListView;->computeScroll()V

    .line 337
    return-void

    .line 331
    :cond_1
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v1}, Landroid/widget/Scroller;->getCurrY()I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewFooter;->setBottomMargin(I)V

    goto :goto_0
.end method

.method public onScroll(Landroid/widget/AbsListView;III)V
    .locals 1
    .param p1, "view"    # Landroid/widget/AbsListView;
    .param p2, "firstVisibleItem"    # I
    .param p3, "visibleItemCount"    # I
    .param p4, "totalItemCount"    # I

    .prologue
    .line 355
    iput p4, p0, Lcom/wmr/Lstview/XListView;->mTotalItemCount:I

    .line 356
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    if-eqz v0, :cond_0

    .line 357
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    invoke-interface {v0, p1, p2, p3, p4}, Landroid/widget/AbsListView$OnScrollListener;->onScroll(Landroid/widget/AbsListView;III)V

    .line 360
    :cond_0
    return-void
.end method

.method public onScrollStateChanged(Landroid/widget/AbsListView;I)V
    .locals 1
    .param p1, "view"    # Landroid/widget/AbsListView;
    .param p2, "scrollState"    # I

    .prologue
    .line 346
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    if-eqz v0, :cond_0

    .line 347
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    invoke-interface {v0, p1, p2}, Landroid/widget/AbsListView$OnScrollListener;->onScrollStateChanged(Landroid/widget/AbsListView;I)V

    .line 349
    :cond_0
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 6
    .param p1, "ev"    # Landroid/view/MotionEvent;

    .prologue
    const v5, 0x3fe66666    # 1.8f

    const/4 v4, 0x0

    const/high16 v2, -0x40800000    # -1.0f

    .line 274
    iget v1, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    cmpl-float v1, v1, v2

    if-nez v1, :cond_0

    .line 275
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F

    move-result v1

    iput v1, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    .line 278
    :cond_0
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    packed-switch v1, :pswitch_data_0

    .line 299
    :pswitch_0
    iput v2, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    .line 300
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->getFirstVisiblePosition()I

    move-result v1

    if-nez v1, :cond_2

    .line 302
    iget-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    if-eqz v1, :cond_1

    .line 303
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v1}, Lcom/wmr/Lstview/XListViewHeader;->getVisiableHeight()I

    move-result v1

    iget v2, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewHeight:I

    if-le v1, v2, :cond_1

    .line 304
    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    .line 305
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    const/4 v2, 0x2

    invoke-virtual {v1, v2}, Lcom/wmr/Lstview/XListViewHeader;->setState(I)V

    .line 306
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mListViewListener:Lcom/wmr/Lstview/XListView$IXListViewListener;

    if-eqz v1, :cond_1

    .line 307
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mListViewListener:Lcom/wmr/Lstview/XListView$IXListViewListener;

    invoke-interface {v1}, Lcom/wmr/Lstview/XListView$IXListViewListener;->onRefresh()V

    .line 310
    :cond_1
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->resetHeaderHeight()V

    .line 312
    :cond_2
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->getLastVisiblePosition()I

    move-result v1

    iget v2, p0, Lcom/wmr/Lstview/XListView;->mTotalItemCount:I

    add-int/lit8 v2, v2, -0x1

    if-ne v1, v2, :cond_4

    .line 314
    iget-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mEnablePullLoad:Z

    if-eqz v1, :cond_3

    .line 315
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v1}, Lcom/wmr/Lstview/XListViewFooter;->getBottomMargin()I

    move-result v1

    const/16 v2, 0x32

    if-le v1, v2, :cond_3

    .line 316
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->startLoadMore()V

    .line 318
    :cond_3
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->resetFooterHeight()V

    .line 322
    :cond_4
    :goto_0
    invoke-super {p0, p1}, Landroid/widget/ListView;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v1

    return v1

    .line 280
    :pswitch_1
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F

    move-result v1

    iput v1, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    goto :goto_0

    .line 283
    :pswitch_2
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F

    move-result v1

    iget v2, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    sub-float v0, v1, v2

    .line 284
    .local v0, "deltaY":F
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawY()F

    move-result v1

    iput v1, p0, Lcom/wmr/Lstview/XListView;->mLastY:F

    .line 285
    sget-object v1, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "ddd---->"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 286
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->getLastVisiblePosition()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 285
    invoke-virtual {v1, v2}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 287
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->getFirstVisiblePosition()I

    move-result v1

    if-nez v1, :cond_6

    .line 288
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mHeaderView:Lcom/wmr/Lstview/XListViewHeader;

    invoke-virtual {v1}, Lcom/wmr/Lstview/XListViewHeader;->getVisiableHeight()I

    move-result v1

    if-gtz v1, :cond_5

    cmpl-float v1, v0, v4

    if-lez v1, :cond_6

    .line 290
    :cond_5
    div-float v1, v0, v5

    invoke-direct {p0, v1}, Lcom/wmr/Lstview/XListView;->updateHeaderHeight(F)V

    .line 291
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->invokeOnScrolling()V

    goto :goto_0

    .line 292
    :cond_6
    invoke-virtual {p0}, Lcom/wmr/Lstview/XListView;->getLastVisiblePosition()I

    move-result v1

    iget v2, p0, Lcom/wmr/Lstview/XListView;->mTotalItemCount:I

    add-int/lit8 v2, v2, -0x1

    if-ne v1, v2, :cond_4

    .line 293
    iget-object v1, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v1}, Lcom/wmr/Lstview/XListViewFooter;->getBottomMargin()I

    move-result v1

    if-gtz v1, :cond_7

    cmpg-float v1, v0, v4

    if-gez v1, :cond_4

    .line 295
    :cond_7
    neg-float v1, v0

    div-float/2addr v1, v5

    invoke-direct {p0, v1}, Lcom/wmr/Lstview/XListView;->updateFooterHeight(F)V

    goto :goto_0

    .line 278
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_0
        :pswitch_2
    .end packed-switch
.end method

.method public setAdapter(Landroid/widget/ListAdapter;)V
    .locals 1
    .param p1, "adapter"    # Landroid/widget/ListAdapter;

    .prologue
    .line 122
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mIsFooterReady:Z

    if-nez v0, :cond_0

    .line 123
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mIsFooterReady:Z

    .line 124
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {p0, v0}, Lcom/wmr/Lstview/XListView;->addFooterView(Landroid/view/View;)V

    .line 126
    :cond_0
    invoke-super {p0, p1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 127
    return-void
.end method

.method public setOnScrollListener(Landroid/widget/AbsListView$OnScrollListener;)V
    .locals 0
    .param p1, "l"    # Landroid/widget/AbsListView$OnScrollListener;

    .prologue
    .line 341
    iput-object p1, p0, Lcom/wmr/Lstview/XListView;->mScrollListener:Landroid/widget/AbsListView$OnScrollListener;

    .line 342
    return-void
.end method

.method public setPullLoadEnable(Z)V
    .locals 2
    .param p1, "enable"    # Z

    .prologue
    const/4 v1, 0x0

    .line 149
    iput-boolean p1, p0, Lcom/wmr/Lstview/XListView;->mEnablePullLoad:Z

    .line 150
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mEnablePullLoad:Z

    if-nez v0, :cond_0

    .line 151
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v0}, Lcom/wmr/Lstview/XListViewFooter;->hide()V

    .line 152
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewFooter;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 165
    :goto_0
    return-void

    .line 154
    :cond_0
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullLoading:Z

    .line 155
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v0}, Lcom/wmr/Lstview/XListViewFooter;->show()V

    .line 156
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewFooter;->setState(I)V

    .line 158
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    new-instance v1, Lcom/wmr/Lstview/XListView$2;

    invoke-direct {v1, p0}, Lcom/wmr/Lstview/XListView$2;-><init>(Lcom/wmr/Lstview/XListView;)V

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewFooter;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    goto :goto_0
.end method

.method public setPullRefreshEnable(Z)V
    .locals 2
    .param p1, "enable"    # Z

    .prologue
    .line 135
    iput-boolean p1, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    .line 136
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mEnablePullRefresh:Z

    if-nez v0, :cond_0

    .line 137
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewContent:Landroid/widget/RelativeLayout;

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    .line 141
    :goto_0
    return-void

    .line 139
    :cond_0
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderViewContent:Landroid/widget/RelativeLayout;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    goto :goto_0
.end method

.method public setRefreshTime(Ljava/lang/String;)V
    .locals 1
    .param p1, "time"    # Ljava/lang/String;

    .prologue
    .line 193
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mHeaderTimeView:Landroid/widget/TextView;

    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 194
    return-void
.end method

.method public setXListViewListener(Lcom/wmr/Lstview/XListView$IXListViewListener;)V
    .locals 0
    .param p1, "l"    # Lcom/wmr/Lstview/XListView$IXListViewListener;

    .prologue
    .line 363
    iput-object p1, p0, Lcom/wmr/Lstview/XListView;->mListViewListener:Lcom/wmr/Lstview/XListView$IXListViewListener;

    .line 364
    return-void
.end method

.method public stopLoadMore()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 181
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullLoading:Z

    if-eqz v0, :cond_0

    .line 182
    iput-boolean v1, p0, Lcom/wmr/Lstview/XListView;->mPullLoading:Z

    .line 183
    iget-object v0, p0, Lcom/wmr/Lstview/XListView;->mFooterView:Lcom/wmr/Lstview/XListViewFooter;

    invoke-virtual {v0, v1}, Lcom/wmr/Lstview/XListViewFooter;->setState(I)V

    .line 185
    :cond_0
    return-void
.end method

.method public stopRefresh()V
    .locals 1

    .prologue
    .line 171
    iget-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    if-eqz v0, :cond_0

    .line 172
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/wmr/Lstview/XListView;->mPullRefreshing:Z

    .line 173
    invoke-direct {p0}, Lcom/wmr/Lstview/XListView;->resetHeaderHeight()V

    .line 175
    :cond_0
    return-void
.end method
